<!--//=========================<script réaliser par :MEZOUARI KHALID>===================-->
{extends file="skulton.tpl"}{/extends}
{block name="monblock"}
<script src="scripts/js/Form.js"></script>
<script>
$(function() {
    //le dialog afficher pour visualiser la photo
    $( "#dialog-form" ).dialog({
      autoOpen: false,
      height: 450,
      width: 600,
      modal: true,
      buttons: {
      },
      close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
      }
    });

    $( ".visualiser_compteRendu" )
      .button()
      .click(function() {
        $( "#dialog-form" ).dialog( "open" );
      });
      
          $( "#form_ajouter" ).dialog({
      autoOpen: false,
      height: 400,
      width: 500,
      modal: true,
      buttons: {
      },
      close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
      }
    });
      
  });

</script>

<script type="text/javascript" charset="utf-8">
  var asInitVals = new Array();
   
  $(document).ready(function() {
 
  // Dialogue  récuperer le lien de la piece jointe
  $('.visualiser_compteRendu').click(function(){
      a= $('.piece',this);
      var piece= $(a[0]).text();
      $("#piece").val(piece);
      $("#dialog-form").html($("<img>").attr("src",piece));
    });
     // Fin dialogue
//dialog de confirmer la supression
      $(".yesno").click(function(){
          var a = $(this);
          $( "#dialog-confirm" ).dialog({
              resizable: false,
              modal: true,
              buttons: {
                "Oui": function() {
                
                  document.location.href="compteRendu.php?id_sup="+a.attr('id');
                },
                "Non": function() {
                  $( this ).dialog( "close" );
                }
              }
          });
        });
/***affichage dialog de confirmation xsl*/
      $(".rep").click(function(){
           var a = $(this);
           $( "#dialog-confirmXSL" ).dialog({
               resizable: false,
               modal: true,
               buttons: {
                 "Générer": function() {
                
                    document.location.href="genererXSL.php?&page=compteRendu";
                 },
                 "non": function() {
                   $( this ).dialog( "close" );
                 }
               }
           });
         });
//dataTable
    var oTable = $('#idtable').dataTable( {
      "sPaginationType": "full_numbers",
      "oLangudateFin": {
        "sSearch": "Rechercher:"
      }
    } );

    //recherche spécifique à la colone footer de datatable
    $("tfoot input").keyup( function () {
      oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );
     
    $("tfoot input").each( function (i) {
      asInitVals[i] = this.value;
    } );
     
    $("tfoot input").focus( function () {
      if ( this.className == "search_init" )
      {
        this.className = "";
        this.value = "";
      }
    } );
     
    $("tfoot input").blur( function (i) {
      if ( this.value == "" )
      {
        this.className = "search_init";
        this.value = asInitVals[$("tfoot input").index(this)];
      }
    } );
  } );
</script>

<div class="content-box"><!-- body -->
  
  <div class="content-box-header">
    <h3>Liste des compteRendus Réalisées</h3>
    <a href="generePDF.php?&page=compteRendu"  style='margin-left:10px;'><img src="images/icons/PDF.png" ></a>
    <a href="#" class="rep" style='margin-left:10px;'><img src="images/icons/excel.png" ></a>
  </div> <!-- End .content-box-:>header -->
  <div class="tab-content default-tab" id="tab1"> 
    {if isset($messdateFin)}
      <div class="notification success png_bg">
        <a href="#" class="close"><img src="imdateFins/icons/cross_grey_small.png" title="Close this notification" alt="close"></a>
        <div>
          {$messdateFin}
        </div>
      </div>
    {/if} 
      <!--confirmer la suppression avec un dialog-->
       <div style="display:none;" id="dialog-confirm" title="Demande de confirmation">
         <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment supprimer cet enregistrement ?</p>
       </div>
      <!--confirmer la generation XSL avec un dialog-->
       <div style="display:none;" id="dialog-confirmXSL" title="Demande de confirmation">
         <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment générer ce fichier dans le bureau ?</p>
       </div>
  
       <table id="idtable">
        
               <thead>
                   <tr>
                    <th><input class="check-all" type="checkbox" /></th>
                    <th>Désignation<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
                    <th>Description<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
                    <th>Date Fin<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
                    <th>Réalisé par<img src="images/icons/sort.png" width="20px"alt="sort" /></th>
			              <th>opération</th>  
                  </tr>
               </thead>

               <tbody>
                 {foreach $return as $compteRendu}
                 <tr>
                   <td><input type="checkbox" /></td>
                   <td>{$compteRendu->getDesignation()}</td>
                   <td>{$compteRendu->getDescription()}</td>
                   <td>{$compteRendu->getDateFin()}</td>
                   <td>{$nomadeDao->loadNomade($compteRendu->getIdNomade())->getNom()}  {$nomadeDao->       loadNomade($compteRendu->getIdNomade())->getPrenom()}</td>
                   <td>
                      <a href="#dialog-form" class="visualiser_compteRendu" ><img width="15px" src="images/seen.png" alt="Edit"  />
                       <span class="piece" style="display:none">{$compteRendu->getPiece()}</span>
                      </a> 
                      <a href="generePDF.php?&idCompteRendu={$compteRendu->getIdCompteRendu()}" title="Imprimer"         id="{$compteRendu->getIdCompteRendu()}"><img src="images/icons/print.png" width="15px"alt="       Imprimer" /></a>
                      <!--supression-->
                       <a href="#" title="Delete" class="yesno with-tip supp" id="{$compteRendu->       getIdCompteRendu()}"><img src="images/icons/cross.png" width="15px" alt="Delete" /></a>
              
                   </td>
                 </tr>
                 {/foreach}
               </tbody>
  
               <tfoot>
                 <tr>
                   <th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
                   <th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
                   <th><input type="text" name="search_designation" value="" class="search_int" /></th>
                   <th><input type="text" name="search_description" value="" class="search_int"  /></th>
                   <th><input type="text" name="search_piece" value="" class="search_int"  /></th>
                   <th><input type="text" name="search_dateFin" value="" class="search_int"  /></th>
                 </tr>
               </tfoot>
        
       </table>
      
      <!--//le dialog dans laquelle on va visualiser la photo-->
       <div id="dialog-form" title="Visualiser photo" class="reformed-form"> 
       </div> 
    </div> <!-- fin #tab2 -->         
  </div> <!-- fin .content-box-content -->
 {/block}